{include file="public/header" /}
<style>
    .layui-form-label{ width: 15%;}
    .layui-input-inline{width: 70% !important; margin-left: 2%;}
    .diqu ul li{
        float: left;
        margin-left: 10px;
        margin-top: 20px;
    }
</style>
<body>
<div class="x-body">
    <form action="{:url('savepsot')}" class="layui-form" id="form">
        <input type="hidden" name="id" value="{$info?$info.id:''}"/>
        
        <div class="layui-form-item">
            <div class="layui-row">
                <label class="layui-form-label layui-col-md2">标题</label>
                <div class="layui-col-md9"> <input type="text" name="title" lay-verify="required" lay-reqtext="请填写标题"
                    placeholder="请填写标题" class="layui-input" value="{$info?$info.title:''}"/>
                </div>
            </div>
        </div>
        
        <div class="layui-form-item">
            <div class="layui-row">
                <label class="layui-form-label layui-col-md2">金额</label>
                <div class="layui-col-md9"> <input type="text" name="money"  lay-reqtext="请填写金额"
                    placeholder="请填写金额" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" class="layui-input" value="{$info?$info.money:'0'}"/>
                </div>
            </div>
        </div>
        
        <div class="layui-form-item">
            <div class="layui-row">
                <label class="layui-form-label layui-col-md2">优惠金额</label>
                <div class="layui-col-md9"> <input type="text" name="sale_money"  lay-reqtext="请填写优惠金额"
                    placeholder="请填写优惠金额" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" class="layui-input" value="{$info?$info.sale_money:'0'}"/>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            
            <div class="layui-row">
                <label class="layui-form-label layui-col-md2">排序</label>
                <div class="layui-col-md9">
                    <input type="number" name="sort" lay-verify="required" lay-reqtext="请填写排序"
                    placeholder="请填写排序" class="layui-input" value="{$info?$info.sort:'0'}"/>
                </div>
            </div>
        </div>
        
        <div class="layui-form-item">
            <div class="layui-row">
                <label class="layui-form-label layui-col-md2">选择商品</label>
                <div class="layui-col-md9 diqu">
                    <ul>
                        {volist name="list" id="vo"}
                        {if in_array($vo.id,$chekid) /}
                        <li><input type="checkbox"  checked name="product_ids[]" value="{$vo.id}" title="{$vo.title}" ></li>
                        {else/}
                        <li><input type="checkbox" name="product_ids[]" value="{$vo.id}" title="{$vo.title}" ></li>
                        {/if}
                        {/volist}
                    </ul>
                </div>
            </div>
        </div>
        <div class="layui-form-item" style="text-align: center;">
            <button class="layui-btn" lay-filter="save" lay-submit formObj="#form">保存</button>
        </div>
    </form>
</div>
</body>
{include file="public/footer" /}
</html>